<html>
<head><meta charset="utf-8"><title>chalk-engine lecture 2019.05.06 · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html">chalk-engine lecture 2019.05.06</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="165006812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165006812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165006812">(May 06 2019 at 18:34)</a>:</h4>
<p><a href="https://paper.dropbox.com/doc/chalk-engine-lecture-2019.05.06--Acnlx2JJbLGF~yZnAjI5~ZNmAg-IISt9WIs4knyZMuv5X3Fm" target="_blank" title="https://paper.dropbox.com/doc/chalk-engine-lecture-2019.05.06--Acnlx2JJbLGF~yZnAjI5~ZNmAg-IISt9WIs4knyZMuv5X3Fm">Paper document</a></p>



<a name="165006870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165006870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165006870">(May 06 2019 at 18:35)</a>:</h4>
<p><a href="https://zoom.us/j/595785544" target="_blank" title="https://zoom.us/j/595785544">Zoom link</a></p>



<a name="165013052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165013052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165013052">(May 06 2019 at 19:50)</a>:</h4>
<p>That went well, with us adding some notes here and there</p>



<a name="165013135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165013135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165013135">(May 06 2019 at 19:51)</a>:</h4>
<p>Yeah, seems good</p>



<a name="165013136"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165013136" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165013136">(May 06 2019 at 19:51)</a>:</h4>
<p>Maybe we could also write down questions inline next time?</p>



<a name="165013138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165013138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165013138">(May 06 2019 at 19:51)</a>:</h4>
<p>Good idea</p>



<a name="165013929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165013929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165013929">(May 06 2019 at 20:00)</a>:</h4>
<p>So one thing I didn't make very clear at the end:</p>



<a name="165013946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165013946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165013946">(May 06 2019 at 20:01)</a>:</h4>
<p>I think that if we don't care about negative cycles, it somewhat simplifies the question of "when to undelay"</p>



<a name="165013965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165013965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165013965">(May 06 2019 at 20:01)</a>:</h4>
<p>But I'd like to understand better the importance of negative cycles here</p>



<a name="165014014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014014">(May 06 2019 at 20:02)</a>:</h4>
<p>It seems... plausible that we could just propagate "non-enumerable" things all the way out, and push the "undelay logic" to some outer loop, too</p>



<a name="165014056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014056">(May 06 2019 at 20:02)</a>:</h4>
<p>Also, one last thing: region constraints can be considered a kind of delayed literal</p>



<a name="165014100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014100">(May 06 2019 at 20:03)</a>:</h4>
<p>Won't there be a problem with delaying too many things, in that you'd have to undelay in a certain order to make progress?</p>



<a name="165014112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014112">(May 06 2019 at 20:03)</a>:</h4>
<p>I don't think so</p>



<a name="165014118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014118">(May 06 2019 at 20:03)</a>:</h4>
<p>Well, it depends what you mean</p>



<a name="165014181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014181">(May 06 2019 at 20:04)</a>:</h4>
<p>I guess the answer is "maybe"</p>



<a name="165014190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014190">(May 06 2019 at 20:04)</a>:</h4>
<p>Heh, that's what you get for asking a vague question, I guess</p>



<a name="165014195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014195">(May 06 2019 at 20:04)</a>:</h4>
<p>(Anyway I think we probably want to undelay more aggressively than what I was suggesting)</p>



<a name="165014201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014201">(May 06 2019 at 20:04)</a>:</h4>
<p>Well, so, specifically -- things like <code>Sized</code> don't "help" with progress</p>



<a name="165014211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014211">(May 06 2019 at 20:04)</a>:</h4>
<p>i.e., <code>Sized</code> never "constrains" its argument really</p>



<a name="165014222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014222">(May 06 2019 at 20:05)</a>:</h4>
<p>but this is perhaps untrue for other traits</p>



<a name="165014249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014249">(May 06 2019 at 20:05)</a>:</h4>
<p>(As an aside,</p>



<a name="165014256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014256">(May 06 2019 at 20:05)</a>:</h4>
<p>one thing I think we could/should also do is to apply some heuristics to the impls of a given trait,</p>



<a name="165014259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014259">(May 06 2019 at 20:05)</a>:</h4>
<p>to try and aid our selection order)</p>



<a name="165014658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014658">(May 06 2019 at 20:10)</a>:</h4>
<p>Another clarification: on quantum</p>



<a name="165014674"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014674" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014674">(May 06 2019 at 20:10)</a>:</h4>
<p>It looks like the time that we use quantum is this</p>



<a name="165014692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014692">(May 06 2019 at 20:10)</a>:</h4>
<ul>
<li>Each time we pursue a strand and it encounters a cycle, we save those strands into a vector</li>
</ul>



<a name="165014709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014709">(May 06 2019 at 20:11)</a>:</h4>
<ul>
<li>But if we pursue a strand and it <em>fails</em> (no answer)</li>
</ul>



<a name="165014732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014732">(May 06 2019 at 20:11)</a>:</h4>
<ul>
<li>then we re-enqueue the remaining cyclic strands onto the table and yield up "quantum exceeded"</li>
</ul>



<a name="165014744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014744">(May 06 2019 at 20:11)</a>:</h4>
<p>because the strands are in a LIFO, we'll come back to them only after trying the other work anyway</p>



<a name="165014811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014811">(May 06 2019 at 20:12)</a>:</h4>
<p>you might wonder why we bother to "stash" the cyclic strnads into the vector anyway</p>



<a name="165014818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014818">(May 06 2019 at 20:12)</a>:</h4>
<p>the idea is that we want to know if ALL of the remaining strands are cyclic</p>



<a name="165014820"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014820" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014820">(May 06 2019 at 20:12)</a>:</h4>
<p>because that means there are no more answers at all</p>



<a name="165014894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014894">(May 06 2019 at 20:13)</a>:</h4>
<blockquote>
<p>one thing I think we could/should also do is to apply some heuristics to the impls of a given trait,</p>
</blockquote>
<p>as a strawman, we could have a hierarchy where you have<br>
1. Traits with non-quantified impls (we can even count the impls here)<br>
2. Traits with universally quantified impls (e.g. <code>impl&lt;T&gt; Foo for Vec&lt;T&gt;</code>)<br>
  - maybe we should split this into bounded (e.g. <code>impl&lt;T: Bar&gt;</code>) and unbounded?<br>
3. Auto traits<br>
  - we can include <code>impl&lt;T&gt; Foo for T</code> in this category</p>



<a name="165014972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014972">(May 06 2019 at 20:14)</a>:</h4>
<p>Yeah, something like that</p>



<a name="165014993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165014993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165014993">(May 06 2019 at 20:14)</a>:</h4>
<p>I think the "bounded and unbounded" -- it might be that we are interesting in DAGs</p>



<a name="165015010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165015010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165015010">(May 06 2019 at 20:14)</a>:</h4>
<p>i.e., if trait Foo includes a bound <code>T: BAr</code>, but <code>Bar</code> has no <code>T: Foo</code> bounds -- that's more ok?</p>



<a name="165015031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165015031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165015031">(May 06 2019 at 20:15)</a>:</h4>
<p>(I always imagined we would kind of look at what impls exist "in practice" to help us drive said heuristics)</p>



<a name="165015049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165015049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165015049">(May 06 2019 at 20:15)</a>:</h4>
<p>but some kind of "locally testable heuristics" seem very good</p>



<a name="165015525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165015525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165015525">(May 06 2019 at 20:20)</a>:</h4>
<p>This resembles a kind of pathfinding algorithm where our nodes are strands, and the cost of traversing each node is its outdegree</p>



<a name="165017901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165017901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165017901">(May 06 2019 at 20:52)</a>:</h4>
<p>So it seems kind of like one could think about this in terms of "collecting constraints", kind of like we do for regions</p>



<a name="165017962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165017962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165017962">(May 06 2019 at 20:53)</a>:</h4>
<p>basically any non-enumerable goal is added as a constraint on a particular strand</p>



<a name="165017978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165017978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165017978">(May 06 2019 at 20:53)</a>:</h4>
<p>I guess that's equivalent to the delayed literals approach niko mentioned</p>



<a name="165018053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018053">(May 06 2019 at 20:54)</a>:</h4>
<p>except for the question of "how does this interact with negative reasoning"</p>



<a name="165018068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018068">(May 06 2019 at 20:54)</a>:</h4>
<p>..maybe we could have two separate mechanisms, one (delayed literals) for negative reasoning, the other (constraints) for non-enumerable goals</p>



<a name="165018080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018080">(May 06 2019 at 20:55)</a>:</h4>
<p>I don't know if I'm making sense :)</p>



<a name="165018101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018101">(May 06 2019 at 20:55)</a>:</h4>
<p>you are, I've been debating if they should be unified or not</p>



<a name="165018292"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018292" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018292">(May 06 2019 at 20:57)</a>:</h4>
<p>I've also been reading the source to remember how this logic works</p>



<a name="165018392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018392">(May 06 2019 at 20:58)</a>:</h4>
<p>I think I have to page back in <a href="https://core.ac.uk/download/pdf/82336448.pdf" target="_blank" title="https://core.ac.uk/download/pdf/82336448.pdf">the EWFS paper</a> as well</p>



<a name="165018449"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018449" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018449">(May 06 2019 at 20:59)</a>:</h4>
<p>another related question is, if we collect these non-enumerable goals as constraints, how complicated could they get, and can we solve them outside of the main engine path?</p>



<a name="165018693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018693">(May 06 2019 at 21:02)</a>:</h4>
<p>(since we're already going to be doing this for region constraints, it seems natural to wonder if things like <code>?T: Sized</code> could take on a similar shape)</p>



<a name="165018704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018704">(May 06 2019 at 21:02)</a>:</h4>
<p>Right, so, if we focus on the case of compiler-builtins, then they would be quite simple. It seems like you could just give up the answer including the delayed literals</p>



<a name="165018708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018708">(May 06 2019 at 21:02)</a>:</h4>
<p>and then have an outer loop to process them</p>



<a name="165018730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018730">(May 06 2019 at 21:02)</a>:</h4>
<p>this would probably include things like <code>Clone</code> though</p>



<a name="165018743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018743">(May 06 2019 at 21:03)</a>:</h4>
<p>process the literal itself can definitely require arbitrary logic</p>



<a name="165018783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018783">(May 06 2019 at 21:03)</a>:</h4>
<p>but this is roughly equivalent to our current solver, but different</p>



<a name="165018839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018839">(May 06 2019 at 21:04)</a>:</h4>
<p>i.e., we assume that during type-checking or whatever you have some "fulfillment context" accumulating things you must prove</p>



<a name="165018855"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018855" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018855">(May 06 2019 at 21:04)</a>:</h4>
<p>so if you get back an answer with delayed things, it can just add those to its list of "stuff to prove eventually"</p>



<a name="165018871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018871">(May 06 2019 at 21:04)</a>:</h4>
<p>(the existing rustc solver does something similar)</p>



<a name="165018992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018992">(May 06 2019 at 21:06)</a>:</h4>
<p>( I am pondering to what extent this can solve the negative problem too )</p>



<a name="165018997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165018997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165018997">(May 06 2019 at 21:06)</a>:</h4>
<p>let me try to spell out what i'm saying</p>



<a name="165019016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019016">(May 06 2019 at 21:06)</a>:</h4>
<p>imagine we had</p>
<div class="codehilite"><pre><span></span><span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nb">Sized</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nb">Vec</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"></span>
</pre></div>



<a name="165019029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019029">(May 06 2019 at 21:07)</a>:</h4>
<p>and then we had to prove <code>?A: Foo</code></p>



<a name="165019055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019055">(May 06 2019 at 21:07)</a>:</h4>
<p>this might result in <code>?A = Vec&lt;?B&gt; modulo ?B: Sized</code></p>



<a name="165019059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019059">(May 06 2019 at 21:07)</a>:</h4>
<p>er, that's a confusing notation :)</p>



<a name="165019076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019076">(May 06 2019 at 21:07)</a>:</h4>
<p>maybe that's less unclear ;)</p>



<a name="165019082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019082">(May 06 2019 at 21:07)</a>:</h4>
<p>point is, it could delay the <code>?B: Sized</code> part (non-enumerable)"</p>



<a name="165019094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019094">(May 06 2019 at 21:07)</a>:</h4>
<p>and hence we would consider <code>?A: Foo</code> "proved" but we would enqueue <code>?B: Sized</code></p>



<a name="165019150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019150">(May 06 2019 at 21:08)</a>:</h4>
<p>now, maybe other parts of the type-checker constrain <code>?B: Sized</code>, and so at some point we have <code>?B = u32</code></p>



<a name="165019174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019174">(May 06 2019 at 21:08)</a>:</h4>
<p>now when we go to "re-prove" <code>?B: Sized</code>, we get <code>u32: Sized</code> and we're all set</p>



<a name="165019200"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019200" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019200">(May 06 2019 at 21:09)</a>:</h4>
<p>(it seems like a similar thing could work for the coinductive case)</p>



<a name="165019226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019226">(May 06 2019 at 21:09)</a>:</h4>
<p>what's nice about this is</p>



<a name="165019236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019236">(May 06 2019 at 21:09)</a>:</h4>
<p>the chalk-engine <em>tables</em> never change</p>



<a name="165019243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019243">(May 06 2019 at 21:09)</a>:</h4>
<p>one thing that's been bugging me with delayed literals is that there is this "simplification" step</p>



<a name="165019313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019313">(May 06 2019 at 21:10)</a>:</h4>
<p>that takes the existing answers, re-evaluates their delays, and can kind of rule them as "succeeded", "failed", or "unknown" as a result</p>



<a name="165019322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019322">(May 06 2019 at 21:10)</a>:</h4>
<p>I mean I guess editing the answers in place is .. fine. It just makes me kind of nervous.</p>



<a name="165019337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019337">(May 06 2019 at 21:10)</a>:</h4>
<p>Because part of the reasoning here is that <code>Answer(Table, Index)</code> (once computed) is always the same</p>



<a name="165019403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019403">(May 06 2019 at 21:11)</a>:</h4>
<blockquote>
<p>what's nice about this is</p>
</blockquote>
<p>what's less nice is that something this is silly</p>



<a name="165019416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019416">(May 06 2019 at 21:11)</a>:</h4>
<p>i.e., if we "delay <code>?B: Sized</code>" but later find out what <code>?B</code> is, we could go ahead and process it right then and there</p>



<a name="165019463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019463">(May 06 2019 at 21:12)</a>:</h4>
<p>otoh, who cares...</p>



<a name="165019506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019506">(May 06 2019 at 21:12)</a>:</h4>
<p>seems (to me) like this 'outer loop' idea is the way to go; there's caching and if it winds up being a perf problem, we could look into something more sophisticated</p>



<a name="165019567"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019567" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019567">(May 06 2019 at 21:13)</a>:</h4>
<p>(in short, we likely got bigger perf problems to solve first)</p>



<a name="165019586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019586">(May 06 2019 at 21:13)</a>:</h4>
<p>is that going to avoid the "editing answer in-place" problem you mentioned?</p>



<a name="165019600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019600">(May 06 2019 at 21:13)</a>:</h4>
<p>(seems like it could)</p>



<a name="165019608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019608">(May 06 2019 at 21:14)</a>:</h4>
<p>the outer loop idea?</p>



<a name="165019649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019649">(May 06 2019 at 21:14)</a>:</h4>
<p>yes</p>



<a name="165019663"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019663" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019663">(May 06 2019 at 21:14)</a>:</h4>
<p>yeah, I mean, the idea is that we just .. never simplify</p>



<a name="165019664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019664">(May 06 2019 at 21:14)</a>:</h4>
<p>we let the outer loop do it</p>



<a name="165019686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019686">(May 06 2019 at 21:14)</a>:</h4>
<p>so we'd have our internal <code>ensure_answer(T0, 0)</code> returns <code>?A = Vec&lt;?B&gt; modulo ?B: Sized</code> and then we remove the <code>modulo</code> part every time</p>



<a name="165019704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019704">(May 06 2019 at 21:15)</a>:</h4>
<p>right</p>



<a name="165019733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019733">(May 06 2019 at 21:15)</a>:</h4>
<p>(but those results are cached etc)</p>



<a name="165019740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019740">(May 06 2019 at 21:15)</a>:</h4>
<p>still, it's probably also fine to remove it in the table itself</p>



<a name="165019842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019842">(May 06 2019 at 21:16)</a>:</h4>
<p>if we did that we'd have to do something with the answers that don't work, i.e. do we leave a placeholder so the index doesn't change</p>



<a name="165019857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019857">(May 06 2019 at 21:16)</a>:</h4>
<p>I don't know that this works for the negative cycle case; well, it works in a sense, I think you would wind up just "reprocessing" the same constraints over and over</p>



<a name="165019884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165019884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165019884">(May 06 2019 at 21:17)</a>:</h4>
<blockquote>
<p>if we did that we'd have to do something with the answers that don't work, i.e. do we leave a placeholder so the index doesn't change</p>
</blockquote>
<p>yes, they would presumably get transformed to "fail" or something</p>



<a name="165020068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165020068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tmandry <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165020068">(May 06 2019 at 21:19)</a>:</h4>
<blockquote>
<p>I think you would wind up just "reprocessing" the same constraints over and over</p>
</blockquote>
<p>I have to go in a sec, but don't quite see why this is true :)</p>



<a name="165020204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165020204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165020204">(May 06 2019 at 21:21)</a>:</h4>
<p>I don't know that it's entirely true :)</p>



<a name="165020312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165020312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165020312">(May 06 2019 at 21:22)</a>:</h4>
<p>(I need to work through some of the examples)</p>



<a name="165020332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165020332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165020332">(May 06 2019 at 21:22)</a>:</h4>
<p>I really do wonder if we should worry about negative reasoning though. Maybe this is all reason enough to rule it out and simplify our lives.</p>



<a name="165020339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165020339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165020339">(May 06 2019 at 21:22)</a>:</h4>
<p>For some reason, I am reluctant to do that, but it's hard for me to say why that is</p>



<a name="165020368"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165020368" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165020368">(May 06 2019 at 21:23)</a>:</h4>
<p>I guess beacuse I'd like to be able to articulate very precisely what the tricky cases are, at minimum, so when people ask, we can answer them</p>



<a name="165095017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165095017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165095017">(May 07 2019 at 17:59)</a>:</h4>
<p>I realized some problems here with this "un-enumerable predicates" idea. I don't know how well it interacts with hereditary harrop predicates like <code>forall&lt;T&gt; { Goal }</code> and so forth. In particular, it seems like you have to capture the universe / environment and things when you propagate the goal back. I .. guess we can do this, it's just kind of an interesting twist.</p>



<a name="165189358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165189358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Julian-Wollersberger <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165189358">(May 08 2019 at 18:43)</a>:</h4>
<p>Was the Zoom meeting not recorded as usual? <br>
I'm asking because there is no video on the YouTube channel.</p>



<a name="165189653"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165189653" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165189653">(May 08 2019 at 18:47)</a>:</h4>
<p>I just didn't post it yet</p>



<a name="165189655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165189655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165189655">(May 08 2019 at 18:47)</a>:</h4>
<p>Will try to do that soon</p>



<a name="165191704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165191704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Julian-Wollersberger <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165191704">(May 08 2019 at 19:09)</a>:</h4>
<p>Thanks :)</p>



<a name="165203395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/chalk-engine%20lecture%202019.05.06/near/165203395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/chalk-engine.20lecture.202019.2E05.2E06.html#165203395">(May 08 2019 at 21:34)</a>:</h4>
<p><span class="user-mention" data-user-id="200368">@Julius-Beides</span> <a href="https://youtu.be/hmV66tB79LM" target="_blank" title="https://youtu.be/hmV66tB79LM">video is uploading at this url</a>, but it's not available yet</p>
<div class="youtube-video message_inline_image"><a data-id="hmV66tB79LM" href="https://youtu.be/hmV66tB79LM" target="_blank" title="https://youtu.be/hmV66tB79LM"><img src="https://i.ytimg.com/vi/hmV66tB79LM/default.jpg"></a></div>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>